package com.erpanderp.wam.usm.view.user;

import java.io.InputStream;
import java.io.Serializable;
import java.text.DateFormatSymbols;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.component.html.HtmlInputText;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.AjaxBehaviorEvent;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.swing.SwingWorker;

import org.primefaces.component.menuitem.MenuItem;
import org.primefaces.context.RequestContext;
import org.primefaces.model.UploadedFile;

import com.erpanderp.wam.adm.model.entity.CustomLookup;
import com.erpanderp.wam.adm.model.entity.LookupValue;
import com.erpanderp.wam.adm.model.entity.Role;
import com.erpanderp.wam.adm.model.entity.SAPERPModule;
import com.erpanderp.wam.adm.model.service.CustomLookupDAO;
import com.erpanderp.wam.adm.model.service.ModuleDAO;
import com.erpanderp.wam.adm.model.service.RoleDAO;
import com.erpanderp.wam.adm.model.service.SAPERPModuleDAO;
import com.erpanderp.wam.usm.model.entity.leave.LeaveBalance;
import com.erpanderp.wam.usm.model.entity.leave.LeaveBalanceTracker;
import com.erpanderp.wam.usm.model.entity.leave.LeaveType;
import com.erpanderp.wam.usm.model.entity.projectandassignment.EmployeeProject;
import com.erpanderp.wam.usm.model.entity.projectandassignment.Project;
import com.erpanderp.wam.usm.model.entity.timesheet.ProjectAssignmentTimesheetDetail;
import com.erpanderp.wam.usm.model.entity.timesheet.Timesheet;
import com.erpanderp.wam.usm.model.entity.timesheet.TimesheetDetail;
import com.erpanderp.wam.usm.model.entity.user.Employee;
import com.erpanderp.wam.usm.model.entity.user.EmployeeAndReporting;
import com.erpanderp.wam.usm.model.entity.user.EmployeeRole;
import com.erpanderp.wam.usm.model.entity.user.NewJoinee;
import com.erpanderp.wam.usm.model.entity.user.WAMUser;
import com.erpanderp.wam.usm.model.service.leave.EmployeeLeaveDAO;
import com.erpanderp.wam.usm.model.service.leave.LeaveTypeDAO;
import com.erpanderp.wam.usm.model.service.projectandassignment.ProjectDAO;
import com.erpanderp.wam.usm.model.service.timesheet.TimesheetDAO;
import com.erpanderp.wam.usm.model.service.timesheet.TimesheetDetailDAO;
import com.erpanderp.wam.usm.model.service.user.EmployeeAndReportingDAO;
import com.erpanderp.wam.usm.model.service.user.EmployeeDAO;
import com.erpanderp.wam.usm.model.service.user.NewJoineeDAO;
import com.erpanderp.wam.util.CommonLookup;
import com.erpanderp.wam.util.EmailUtil;
import com.erpanderp.wam.util.ValidationUtil;
import com.erpanderp.wam.util.WAMHostManager;
import com.erpanderp.wam.util.WAMPasswordUtil;
import com.erpanderp.wam.util.WAMUtil;

@ManagedBean
@ViewScoped
public class EmployeeRegisterBean implements Serializable {
	HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
			.getExternalContext().getSession(true);
	private static final long serialVersionUID = 1L;
	ServletContext context = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();


	private String REGISTRATION_THROUGH_EFORM = "No";
	Employee employee = new Employee();
	EmployeeAndReporting employeeAndReporting = new EmployeeAndReporting();
	private EmployeeAndReportingDAO employeeAndReportingDAO = new EmployeeAndReportingDAO();
	private WAMUser wamUser = new WAMUser();
	private EmployeeRole employeeRole = new EmployeeRole();

	ModuleDAO moduleDAO = new ModuleDAO();
	RoleDAO roleDAO = new RoleDAO();
	EmployeeDAO employeeDAO = new EmployeeDAO();
	SAPERPModuleDAO saperpModuleDAO = new SAPERPModuleDAO();

	private Map<String, Long> rolesMap = new HashMap<String, Long>();
	private boolean RENDER_OTHER_MODULE;
	private boolean RENDER_OTHER_DESIGNATION;
	private Long selectedModuleId;
	private Long selectedRoleId;
	private String authentication;
	List<Role> roles = new ArrayList<Role>();
	// SAPERPMODULES
	private Long selectedSAPERPModule;

	private Map<String, String> saperpModules = new HashMap<String, String>();
	private List<SAPERPModule> saperpModulesList = new ArrayList<SAPERPModule>();
	//
	// REPORTING MANAGERS AND LEADS
	private Long selectedCompetencyLeadId;
	private Map<String, Long> competencyLeadsMap = new HashMap<String, Long>();
	private List<Employee> competencyLeads = new ArrayList<Employee>();

	private Long selectedProjectManagerId;
	private Map<String, Long> projectManagersMap = new HashMap<String, Long>();
	private List<Employee> projectManagers = new ArrayList<Employee>();

	private Long selectedCenterHeadId;
	private Map<String, Long> centerHeadMap = new HashMap<String, Long>();
	private List<Employee> centerHeads = new ArrayList<Employee>();

	
	private List<EmployeeAndReporting> employeeAndReportinList = new ArrayList<EmployeeAndReporting>();
	private Map<String, Long> employeeAndReportingMap = new HashMap<String, Long>();

	private Map<String, String> designationsMap = new HashMap<String, String>();
	private Long selectedDesignationId;
	private String selectedDesignation;
	private EmployeeProject employeeProject = new EmployeeProject();

	private Map<String, String> projectsStatusMap = CommonLookup
			.getProjectsStatusMap();
	private Long selectedProjectsStatusId;

	private Map<String, String> authenticationsMap = CommonLookup
			.getAuthenticationsMap();
	private Long selectedAuthenticatoin;

	private Map<String, String> resignedMap = CommonLookup.getResignedMap();
	private Long selectedResigned;

	private String selectedProject;
	private List<Project> projects = new ArrayList<Project>();
	private Map<String, String> projectsMap = new HashMap<String, String>();
	private ProjectDAO projectDAO = new ProjectDAO();

	private List<NewJoinee> newJoineesList = new ArrayList<NewJoinee>();

	private boolean FORM_VALID;
	private NewJoineeDAO newJoineeDAO = new NewJoineeDAO();
	private Role role = new Role();

	private NewJoinee selectedNewJoinee;
    
	private HtmlInputText firstNameInputText;
	private HtmlInputText lastNameInputText;
	private HtmlInputText dateOfJoiningInputText;
	private HtmlInputText dateOfBirthInputText;
	private HtmlInputText telephoneInputText;
	private HtmlInputText emailInputText;
	private WAMUser wamUserToRegister = new WAMUser();
	private Employee centerHead = new Employee();
	private Employee projectManager = new Employee();
	private Employee competency = new Employee();
	private Role selectedRole;
	private EmailUtil emailUtil;
	private  String EMAIL_MESSAGE;
	private Map<String,String> projectStatusMap = new HashMap<String, String>();
	private EmailUtil itTeamEmailUtil;

	private byte[] image;

	private UploadedFile file;
	private InputStream is;
	private List<LeaveType> leaveTypes = new ArrayList<LeaveType>();
	private LeaveBalance leaveBalance;
	private LeaveTypeDAO leaveTypeDAO = new LeaveTypeDAO();
	private List<LeaveBalance> leaveBalancesToBeAssigned = new ArrayList<LeaveBalance>();

	TimesheetDetailDAO timesheetDetailDAO = new TimesheetDetailDAO();
	private List<LookupValue> lookupValuesList = new ArrayList<LookupValue>();
	private String otherModule;
	private String otherDesignation;
	private SAPERPModuleDAO sapERPModuleDAO = new SAPERPModuleDAO();
	private CustomLookupDAO customLookupDAO = new CustomLookupDAO();
	
	public EmployeeRegisterBean() {
		wamUser = ((WAMUser) session
				.getAttribute(CommonLookup.SESSION_ATTRIBUTE_WAMUSER));
		if (wamUser != null) {
			// newJoineesList = newJoineeDAO.getAllNewJoinees();
			projectStatusMap = CommonLookup.getProjectsStatusMap();
			
			competencyLeads = employeeDAO.getCompetencyLeads();
			for (Employee employee : competencyLeads) {
				competencyLeadsMap.put(employee.getFirstName()+employee.getLastName(),
						employee.getEmployeeId());
			}

			projectManagers = employeeAndReportingDAO.getAllLeadEmployeesList();
			for (Employee employee : projectManagers) {
				projectManagersMap.put(employee.getFirstName()+employee.getLastName(),
						employee.getEmployeeId());
			}

			centerHeads = employeeDAO.getCenterHeads();
			for (Employee employee : centerHeads) {
				centerHeadMap.put(employee.getFirstName()+employee.getLastName(),
						employee.getEmployeeId());
			}

			roles = roleDAO.getAllRoles();
			for (Role role : roles) {
				rolesMap.put(role.getDisplayName(), role.getRoleId());
			}

			saperpModulesList = saperpModuleDAO.getSAPERPModules();
			for (SAPERPModule saperpModule : saperpModulesList) {
				saperpModules.put(saperpModule.getSAPERPModule(),
						saperpModule.getSAPERPModule());
			}

			projects = projectDAO.getAllProjects();
			for (Project project : projects) {
				projectsMap.put(project.getProjectName(),
						project.getProjectName());
			}
			
			lookupValuesList = new CustomLookupDAO().getLookupValuesListByCustomLookupName(CommonLookup.DESIGNATION_CUSTOMLOOKUP_VALUE);
			for(LookupValue lookupValue : lookupValuesList){
				designationsMap.put(lookupValue.getLookupName(), lookupValue.getLookupValue());
			}
			leaveTypes = leaveTypeDAO.getLeaveTypes();
			System.out.println("LEAVE TYPES SIZE =" + leaveTypes.size());
			String employeeCode = employeeDAO.generateEmployeeCode();
			System.out.println("EMPLOYEE CODE =" + employeeCode);
			employee.setEmployeeCode(employeeCode);
			System.out.println("EMPLOYEE REGISTRATION BEAN INTIALIZING");

		} else {
			ValidationUtil.gotoLoginPage();
		}
	}

	
	public String saveEmployee() throws Exception {

		validate();
		if (FORM_VALID) {
			wamUserToRegister.setEmployeeCode(employee.getEmployeeCode());
			wamUserToRegister.setPassword(WAMPasswordUtil.encrypt("erp123"));
			wamUserToRegister.setCreatedate(new Date());
			wamUserToRegister.setCreatedBy(wamUser.getEmployee().getFirstName());
			wamUserToRegister.setStatus(CommonLookup.STATUS_ACTIVE);
			wamUserToRegister.setEmployee(employee);
			employee.getWAMUsers().add(wamUserToRegister);
			

			employeeRole.setRole(roleDAO.getRoleByRoleID(role.getRoleId()));
			employeeRole.setCreatedBy(wamUser.getEmployee().getFirstName());
			employeeRole.setCreateDate(new Date());
			employeeRole.setStatus(CommonLookup.STATUS_ACTIVE);
			employeeRole.setEmployee(employee);
			employee.getEmployeeRoles().add(employeeRole);
		
			employeeAndReporting.setCenterHead(employeeDAO.getEmployeeByEmployeeId(centerHead.getEmployeeId()));
			employeeAndReporting.setCompetencelead(employeeDAO.getEmployeeByEmployeeId(competency.getEmployeeId()));
			employeeAndReporting.setProjectManager(employeeDAO.getEmployeeByEmployeeId(projectManager.getEmployeeId()));
			
			for(LeaveType leaveType : leaveTypes){
				leaveBalance = new LeaveBalance();
				if(leaveType.getLeaveType().equals(CommonLookup.SICKLEAVE_TYPE)){					 
					leaveBalance.setBalance(0F);
				 }else if(leaveType.getLeaveType().equals(CommonLookup.PRIVILIZEDLEAVE_TYPE)){
					 leaveBalance.setBalance(0F);					 
				 }else if(leaveType.getLeaveType().equals(CommonLookup.CASUALLEAVE_TYPE)){
					 leaveBalance.setBalance(0F);
					 
				 }else if(leaveType.getLeaveType().equals(CommonLookup.WORKFROMHOME_TYPE)){
					 leaveBalance.setBalance(0F);
					
				 }else if(leaveType.getLeaveType().equals(CommonLookup.OPTIONALLEAVE_TYPE)){
					 leaveBalance.setBalance(0F);
					 
				 }else if(leaveType.getLeaveType().equals(CommonLookup.COMP_OF_TYPE)){
					 leaveBalance.setBalance(0F);
					 
				 }else{
					 leaveBalance.setBalance(0F);					 
				 }
				 leaveBalance.setCreateDate(new Date());
				 leaveBalance.setEmployee(employee);
				 leaveBalance.setLeaveType(leaveType);
				 leaveBalance.setStatus("ACTIVE");
				 leaveBalancesToBeAssigned.add(leaveBalance);
				
			 }
			 
				
			employeeAndReporting.setStatus(CommonLookup.STATUS_ACTIVE);
			employeeAndReporting.setCreateDate(new Date());
			employeeAndReporting.setCreatedBy(wamUser.getEmployee().getFirstName());
			employeeAndReporting.setEmployee(employee);
			
			System.out.println("Role: " + employeeRole.getRole());
	
			if(employeeRole.getRole() != null && employeeRole.getRole().getRole() != null && !employeeRole.getRole().getRole().equals(CommonLookup.STANDARD_ROLE_CMD) && !employeeRole.getRole().getRole().equals(CommonLookup.STANDARD_ROLE_VP))
				employeeAndReporting.setProject(CommonLookup.PROJECT_KA);
			employee.getEmployeeAndReportings().add(employeeAndReporting);
			
			employee.setCreateDate(new Date());
			employee.setCreatedBy(wamUser.getEmployee().getFirstName());
			employee.setStatus("ACTIVE");
			if(employee != null && employee.getModuleName().equals("Other")){
				employee.setModuleName(otherModule);
				SAPERPModule sapERPModule = new SAPERPModule();
				sapERPModule.setSAPERPModule(otherModule);
				sapERPModule.setDisplayName(otherModule);
				sapERPModule.setCreateDate(new Date());
				sapERPModule.setCreatedBy(wamUser.getEmployee().getFirstName()+""+wamUser.getEmployee().getLastName());
				sapERPModule.setStatus(CommonLookup.STATUS_ACTIVE);
				sapERPModuleDAO.createSAPERPModule(sapERPModule);
			}
			if(employee != null && employee.getDesignation().equals("Other")){
				employee.setDesignation(otherDesignation);
				CustomLookup customLookup = new CustomLookupDAO().getCustomLookUp(CommonLookup.DESIGNATION_CUSTOMLOOKUP_VALUE);
				LookupValue lookUpValue = new LookupValue();
				lookUpValue.setCustomLookup(customLookup);
				lookUpValue.setLookupValue(otherDesignation);
				lookUpValue.setLookupName(otherDesignation);
				lookUpValue.setCreateDate(new Date());
				lookUpValue.setCreatedBy(wamUser.getEmployee().getFirstName()+" "+wamUser.getEmployee().getLastName());
				lookUpValue.setStatus(CommonLookup.STATUS_ACTIVE);
				
				customLookupDAO.createLookupValue(lookUpValue);
			}
			
		
			
		    if(REGISTRATION_THROUGH_EFORM != null && REGISTRATION_THROUGH_EFORM.equals("Yes")){
			selectedNewJoinee.setModifiedBy(wamUser.getEmployee().getFirstName());
			selectedNewJoinee.setDateModified(new Date());
			selectedNewJoinee.setEnrolementStatus(CommonLookup.ENROLLMENT_STATUS_ENROLLED);
			
			selectedNewJoinee.getEmployees().add(employee);

            if(newJoineeDAO.enrollNewJoinee(selectedNewJoinee) != null){
			FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO,"New joinee registered as employee successfully.", ""));
            }else{
            	FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO," Employee registration failled.", ""));
            }
		    }else{
		    	if(employeeDAO.registerEmployee(employee) != null){
		    		FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO," Employee registered successfully.", ""));
		    		generateTimesheetDetails();
		    		System.out.println("LEAVE BALANCES SIZE TO BE ASSIGNED ="+leaveBalancesToBeAssigned.size());
					employeeDAO.assignLeaveBalance(leaveBalancesToBeAssigned);
							
			
					//String[] to={employee.getEmail()};
					Map<String, String> hostsMap = WAMHostManager.getWAMHosts(context);

					emailUtil = new EmailUtil();
					itTeamEmailUtil = new EmailUtil();
					
					if(hostsMap.get(CommonLookup.DEV_EMAIL) == null){

					String[] to = {employee.getEmail()};
					String[] toIT = {"network.hyderabad@erpanderp.com"};
					emailUtil.setRecieverAddresses(to);
					
				}else{
					String[] to = {hostsMap.get(CommonLookup.DEV_EMAIL)};
					String[] toIT = {hostsMap.get(CommonLookup.DEV_EMAIL)};
					
					emailUtil.setRecieverAddresses(to);
					itTeamEmailUtil.setRecieverAddresses(toIT);
				}
			 		
			 		String messageStringToEmployee = "Dear " + employee.getFirstName() + " " + employee.getLastName() + "" +
			 								",<br /><br />" +
			 								
			 								"<b>Your WAM credentials are given below :</b><br/><br/>"+
			 								"<table style='border: 1px solid #d9d9d9;'>" +
			 						        "<tr> <td>Employee Id </td><td> : </td><td>" + employee.getEmployeeCode()+ " </td></tr>" +
			 						        "<tr> <td>Password</td><td> : </td> <td>" + WAMPasswordUtil.decrypt(wamUser.getPassword()) + " </td></tr>" +						       
			 						        "</table><br/>"+	
			 						       
			 						   					
			 								"Thanks & Regards, <br />"+CommonLookup.WAM_DEVTEAM_SIGNATURE;
			 		
			 		

			 		String messageStringToITTeam = "Dear IT Team" +
			 								",<br /><br />" +
			 								
			 								"<b>New employee joined in our organization please find the following details of employee:</b><br/><br/>"+
			 								"<table style='border: 1px solid #d9d9d9;'>" +
			 						        "<tr> <td>Employee Id </td><td> : </td><td>" + employee.getEmployeeCode()+ " </td></tr>" +
			 						        "<tr> <td>Name</td><td> : </td> <td>" + employee.getFirstName() +" "+ employee.getLastName()+" </td></tr>" +
			 						       
			 						        "</table><br/>"+	
			 						       "Please provide the following assets to employee."+"<br/>"+
			 						        "1. Employee Access Card"+"<br/>"+
			 						      
			 						        "2. System Allocation"+"<br/>"+"<br/>"+
			 						       
			 						   					
			 								"Thanks & Regards, <br />"+"HR Executive";
			 		
			 		itTeamEmailUtil.setSubject("New Employee Assets");
			 		itTeamEmailUtil.setMessage(messageStringToITTeam);
			 		itTeamEmailUtil.setSenderEmail("podquick@erpanderp.com", "WAM - Dev Team");
			 		emailUtil.setMessage(messageStringToEmployee);
			 		
			 		//emailUtil.setRecieverAddresses(to);
			 		emailUtil.setSenderEmail("podquick@erpanderp.com", "WAM - Dev Team");
			 		emailUtil.setSubject("WAM - User credentails");
			        
			 		SwingWorker worker = new SwingWorker<String, Object>() {
			 			@Override
			 			protected String doInBackground() throws Exception {
			 				EMAIL_MESSAGE = emailUtil.processAndSendEmail();
			 				EMAIL_MESSAGE = itTeamEmailUtil.processAndSendEmail();
			 				return null;
			 			}

			 			@Override
			 			protected void done() {
			 					System.out.println("DONE " + EMAIL_MESSAGE);		
			 			}
			 		};
			 		worker.execute();
			 		System.out.println( "BEFORE RETURNING: " + EMAIL_MESSAGE);
			 		
			 		employee = new Employee();
					REGISTRATION_THROUGH_EFORM = "No";
					employee.setEmployeeCode(employeeDAO.generateEmployeeCode());
					selectedRoleId = null;
					employeeRole = new EmployeeRole();
					employeeAndReporting = new EmployeeAndReporting();
					selectedProjectManagerId = null;
					selectedCompetencyLeadId = null;
					selectedCenterHeadId = null;
					employeeAndReporting = new EmployeeAndReporting();
					return EMAIL_MESSAGE;
		            }else{
		            	FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO," Employee registration failled.", ""));
		            }	
		    }
			employee = new Employee();
			REGISTRATION_THROUGH_EFORM = "No";
			employee.setEmployeeCode(employeeDAO.generateEmployeeCode());
			selectedRoleId = null;
			selectedProjectManagerId = null;
			selectedCompetencyLeadId = null;
			selectedCenterHeadId = null;
			employeeAndReporting = new EmployeeAndReporting();
		}else{
			
		}
		return null;
	}

	
	private void generateTimesheetDetails(){
		WAMUtil wamUtil = new WAMUtil();
		List<TimesheetDetail> timesheetDetails = new ArrayList<TimesheetDetail>();
		String monthNames[] = new DateFormatSymbols().getMonths();
		String dayNames[] = new DateFormatSymbols().getWeekdays();
		
		//Generating...
		
		//Businness rule to maintain timesheet for next month if date > 24
		Calendar calendar = Calendar.getInstance();
		
		if(calendar.get(Calendar.DAY_OF_MONTH) > 24){
			calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) + 1);
		}
		
		//set month and year
		String timesheetMonth = monthNames[calendar.get(Calendar.MONTH)].toUpperCase();
		Integer year = calendar.get(Calendar.YEAR);
		
		Date startDate = null;
		Date endDate = null;
		
		endDate = wamUtil.getTimesheetEndDate(timesheetMonth);
		Calendar temp = Calendar.getInstance();
		temp.setTime(employee.getDateOfJoining());
		startDate = temp.getTime();
		
		Timesheet timesheet = new Timesheet();
		timesheet.setApprover(employeeDAO.getEmployeeByEmployeeId(projectManager.getEmployeeId()));
		timesheet.setMonth(timesheetMonth);
		timesheet.setYear(year);
		while(startDate.before(endDate) || startDate.equals(endDate)){
			Calendar tempCal = Calendar.getInstance();
			tempCal.setTime(startDate);
			
			TimesheetDetail timesheetDetail = new TimesheetDetail();
			timesheetDetail.setTimesheetDate(startDate);
			timesheetDetail.setDayOfWeek(dayNames[tempCal.get(Calendar.DAY_OF_WEEK)]);
			if(timesheetDetail.getDayOfWeek().equalsIgnoreCase("Saturday") || timesheetDetail.getDayOfWeek().equalsIgnoreCase("Sunday")){
				timesheetDetail.setActivity(CommonLookup.TEXT_WEEK_OFF);
			}
			
			//Other Attributes...
			timesheetDetail.setCreateDate(new Date());
			timesheetDetail.setCreatedBy(wamUser.getEmployee().getFirstName());
			timesheetDetail.setStatus(CommonLookup.STATUS_ACTIVE);
			timesheetDetail.setTimesheet(timesheet);
			
			timesheetDetails.add(timesheetDetail);
			
			tempCal.add(Calendar.DAY_OF_MONTH, 1);
			startDate = tempCal.getTime();
			
			/*if(IN_PROJECT){
				List<EmployeeProject> employeeProjects = employeeProjectDAO.getAllEmployeeProjects(wamUser.getEmployee().getEmployeeId());
				
				if(employeeProjects != null && employeeProjects.size() > 0){
					for(EmployeeProject employeeProject : employeeProjects){
						ProjectAssignmentTimesheetDetail assignmentTimesheetDetail = new ProjectAssignmentTimesheetDetail();
						assignmentTimesheetDetail.setEmployeeProject(employeeProject);
						assignmentTimesheetDetail.setTimeSpent("00.00");
						assignmentTimesheetDetail.setTimesheetDetail(timesheetDetail);
						timesheetDetail.getProjectAssignmentTimesheetDetails().add(assignmentTimesheetDetail);
						employeeProject.getProjectAssignmentTimesheetDetails().add(assignmentTimesheetDetail);
					}	
				}
			}
		}*/

			timesheet.getTimesheetDetails().addAll(timesheetDetails);
			
		}
		
		if(saveTimesheet(timesheet)){
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Timesheet generated and saved.", ""));
		}else{
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error while generating timesheet", ""));			
		}
	
		
	}
	
	private boolean saveTimesheet(Timesheet timesheet){
		Date now = new Date();
		timesheet.setCreateDate(now);
		timesheet.setCreatedBy(wamUser.getEmployee().getFirstName());
		timesheet.setEmployee(employee);
		timesheet.setTimesheetStatus(CommonLookup.TIMESHEET_STATUS_NOT_SUBMITTED);
		timesheet.setStatus(CommonLookup.STATUS_ACTIVE);
		TimesheetDAO timesheetDAO = new TimesheetDAO();
		if(timesheetDAO.createTimesheet(timesheet) != null){
			return true;
		}else{
			return false;
		}
	}	
	public void copyEmployeeFromNewJoinee() {
	
		employee.setNewJoinee(selectedNewJoinee);
		employee.setFirstName(selectedNewJoinee.getFirstName());
		employee.setLastName(selectedNewJoinee.getLastName());
		employee.setTelephone(selectedNewJoinee.getTelephone());
		employee.setDateOfJoining(selectedNewJoinee.getDateOfJoining());
		employee.setEmail(selectedNewJoinee.getEmail());
		employee.setDateOfBirth(selectedNewJoinee.getDateofbirth());

		employee.setPrimarySkill(selectedNewJoinee.getPrimarySkill());
	}
	
	public void otherModuleListner(AjaxBehaviorEvent a){
		System.out.println("MODULE LISTNER");
		System.out.println("SELECTED MODULE ="+employee.getModuleName());
		if(employee.getModuleName() != null && employee.getModuleName().equals("Other")){
			
			RENDER_OTHER_MODULE = true;
			employee.setModuleName(otherModule);
		}else{
			RENDER_OTHER_MODULE = false;
			System.out.println("SELECTED MODULE ="+employee.getModuleName());
		}
		
	}
	
	public void otherDesignationListner(AjaxBehaviorEvent a){
		System.out.println("MODULE LISTNER");
		System.out.println("SELECTED MODULE ="+employee.getDesignation());
		if(employee.getDesignation() != null && employee.getDesignation().equals("Other")){
			
			RENDER_OTHER_DESIGNATION = true;
			employee.setDesignation(otherDesignation);
		}else{
			RENDER_OTHER_DESIGNATION = false;
			System.out.println("SELECTED MODULE ="+employee.getDesignation());
		}
		
	}


	
	public void validate() {
		System.out.println("IN VALIDATE FORM");
		FORM_VALID = true;
        
		 
	    Role selectedRole = new RoleDAO().getRoleByRoleID((role.getRoleId() != 0) ? role.getRoleId() : 0);
		
        
		
		
		
		if (ValidationUtil.isEmpty(employee.getEmployeeCode(), "Employee ID",
				null, FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(
				(employee.getDateOfJoining() != null) ? employee
						.getDateOfJoining().toString() : null,
				"Date of Joining ", null, FacesContext.getCurrentInstance()) != null) {
			System.out.println("Display Name is empty.");
			FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(employee.getFirstName(), " First Name ",
				null, FacesContext.getCurrentInstance()) != null) {
			System.out.println("Display Name is empty.");
			FORM_VALID = false;
		}

		if (ValidationUtil.isEmpty(employee.getLastName(), "Last Name ", null,
				FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(employee.getTelephone(), "Contact Number",
				null, FacesContext.getCurrentInstance()) != null) {
			System.out.println("Display Name is empty.");
			FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(employee.getEmail(), "Email", null,
				FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		} else {
			System.out.println("EMAIL ENTERED");
			if (ValidationUtil.isEmailValid(employee.getEmail(), "Email", null,
					FacesContext.getCurrentInstance()) != null) {
				FORM_VALID = false;
			} else {
				System.out.println("WARNING MESSAGE IS NULL");
			}
		}

		if (ValidationUtil.isEmpty(
				(employee.getDateOfBirth() != null) ? employee.getDateOfBirth()
						.toString() : null, "Date of Birth ", null,
				FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}else{
			System.out.println("DATE OF BIRTH IS ENTERED BY NEW JOINEE");
			if(ValidationUtil.isDOBDateValid(employee.getDateOfBirth().toString(),"",null,FacesContext.getCurrentInstance()) != null){
				System.out.println("FORM VALID FALSE-------");
				FORM_VALID = false;
			}
		}
		if (ValidationUtil.isEmpty(employee.getLocation(), "Location ", null,
				FacesContext.getCurrentInstance()) != null) {
			System.out.println("Display Name is empty.");
			FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(employee.getPrimarySkill(),
				"Primary Skill e", null, FacesContext.getCurrentInstance()) != null) {
			System.out.println("Display Name is empty.");
			FORM_VALID = false;
		}

		/*if (ValidationUtil.isEmpty(employee.getSecondarySkill(),
				"Secondary Skill ", null, FacesContext.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}*/
		
		  if(ValidationUtil.isEmpty(employee.getModuleName(), "Module",
		   null, FacesContext.getCurrentInstance()) != null){
		   System.out.println("Display Name is empty."); FORM_VALID = false; 
		  }else if(employee.getModuleName() != null && employee.getModuleName().equals("Other")){

				if (ValidationUtil.isEmpty(otherModule, "Module",
						null, FacesContext.getCurrentInstance()) != null) {
					
					FORM_VALID = false;
				}
			}
		 

		if (ValidationUtil.isEmpty(employee.getDesignation(), "Designation",
				null, FacesContext.getCurrentInstance()) != null) {
			
			FORM_VALID = false;
		}else if(employee.getDesignation() != null && employee.getDesignation().equals("Other")){

			if (ValidationUtil.isEmpty(otherDesignation, "Designation",
					null, FacesContext.getCurrentInstance()) != null) {
				
				FORM_VALID = false;
			}
		}

		if (ValidationUtil.isEmpty((role.getRoleId() != 0) ? role.getRoleId().toString() : null,
				"Role ", null, FacesContext.getCurrentInstance()) != null) {
			
			
			FORM_VALID = false;
		}
		/*
		 * if(ValidationUtil.isEmpty(employee.getAuthentication(),
		 * "Authentication", null, FacesContext.getCurrentInstance()) != null){
		 * System.out.println("Display Name is empty."); FORM_VALID = false; }
		 */
		
		/*if(selectedRole == null){ 
		if (ValidationUtil.isEmpty((employeeAndReporting.getStartDate() != null) ? employeeAndReporting.getStartDate().toString() : null,"Project Start Date", null, FacesContext
								.getCurrentInstance()) != null) {
			
			FORM_VALID = false;
		}
		}else if(selectedRole  != null && !selectedRole.equals("Vice President")){
			
			if (ValidationUtil.isEmpty((employeeAndReporting.getStartDate() != null) ? employeeAndReporting.getStartDate().toString() : null,"Project Start Date", null, FacesContext
					.getCurrentInstance()) != null) {

              FORM_VALID = false;
		}
		}else{
			System.out.println("VP SELECTED");
		}
			
			
		if(selectedRole == null){	
		if (ValidationUtil.isEmpty((employeeAndReporting.getEndDate() != null) ? employeeAndReporting.getEndDate().toString() : null,"Project End Date", null, FacesContext.getCurrentInstance()) != null) {
			
			FORM_VALID = false;
		}
		}else if(selectedRole  != null && !selectedRole.equals("Vice President")){
			if (ValidationUtil.isEmpty((employeeAndReporting.getEndDate() != null) ? employeeAndReporting.getEndDate().toString() : null,"Project End Date", null, FacesContext.getCurrentInstance()) != null) {
				
				FORM_VALID = false;
			}
		}
		else{
			System.out.println("VP SELECTED");
		}*/
		
		 /*if(ValidationUtil.isEmpty(employeeAndReporting.getProjectStatus(),
		 "Project Status ", null, FacesContext.getCurrentInstance()) != null){
		 System.out.println("Project Status  is empty."); FORM_VALID = false;
		 }*/
		 
		if(selectedRole == null){
			 if(ValidationUtil.isEmpty((projectManager.getEmployeeId() != 0) ? projectManager.getEmployeeId().toString() : null, "Project Manager", null, FacesContext.getCurrentInstance()) != null){
				 System.out.println("Project manager is empty."); 
                 FORM_VALID = false;
					
			 }
		}else if(selectedRole != null &&  !selectedRole.getRole().equals(CommonLookup.STANDARD_ROLE_CMD)){
			System.out.println("SELECTED ROLE IS NOT VP AND CMD----------> ");
		 if(ValidationUtil.isEmpty((projectManager.getEmployeeId() != 0) ? projectManager.getEmployeeId().toString() : null, "Project Manager", null, FacesContext.getCurrentInstance()) != null){
			 System.out.println("Project manager is empty."); 
			
			
					FORM_VALID = false;
				
		 }
		}else{
			System.out.println("VP || CMD SELECTED");
		}
		
		
		
		if(selectedRole == null){
			 if(ValidationUtil.isEmpty((competency.getEmployeeId() != 0) ? competency.getEmployeeId().toString() : null, "Competency Lead ", null,
				       FacesContext.getCurrentInstance()) != null){ 
					   System.out.println("Compentency Led is empty."); 
					  
					
							FORM_VALID = false;
			 }
		}else if(selectedRole != null &&  !selectedRole.getRole().equals(CommonLookup.STANDARD_ROLE_CMD)){
			System.out.println("SELECTED ROLE IS NOT VP----------> ");
		  if(ValidationUtil.isEmpty((competency.getEmployeeId() != 0) ? competency.getEmployeeId().toString() : null, "Competency Lead ", null,
		       FacesContext.getCurrentInstance()) != null){ 
			   System.out.println("Compentency Led is empty."); 
			  
			
					FORM_VALID = false;
				
		  }
		}else{
			System.out.println("VP SELECTED");
		}
		 
		if(selectedRole == null){
			 if(ValidationUtil.isEmpty((centerHead.getEmployeeId() != 0) ? centerHead.getEmployeeId().toString() : null,"Center Head ", null, FacesContext.getCurrentInstance()) != null){
				   System.out.println("CenterHead is empty."); 
				     FORM_VALID = false;
				 
				  }

		}else if(selectedRole != null && (!selectedRole.getRole().equals(CommonLookup.STANDARD_ROLE_CMD) && !selectedRole.getRole().equals(CommonLookup.STANDARD_ROLE_VP))){

			System.out.println("SELECTED ROLE IS NOT VP----------> ");
		if(selectedRole.getRole().equals(CommonLookup.STANDARD_ROLE_CH)){
			System.out.println("---------SELECTED ROLE IS CENTER HEAD------------");
		}else{
		 if(ValidationUtil.isEmpty((centerHead.getEmployeeId() != 0) ? centerHead.getEmployeeId().toString() : null,"Center Head ", null, FacesContext.getCurrentInstance()) != null){
		   System.out.println("CenterHead is empty."); 
		     FORM_VALID = false;
		 
		  }
		}
		}else{
			System.out.println("VP SELECTED");
		}
		 
		/*
		 * if(ValidationUtil.isEmpty(employeeAndReporting.getResigned(),
		 * "	Resigned", null, FacesContext.getCurrentInstance()) != null){
		 * System.out.println("Resigned is empty."); FORM_VALID = false; }
		 */

		/*if (ValidationUtil
				.isEmpty(
						(employeeAndReporting.getLastRolloffdate() != null) ? employeeAndReporting
								.getLastRolloffdate().toString() : null,
						"Last Rolloff Date", null, FacesContext
								.getCurrentInstance()) != null) {
			FORM_VALID = false;
		}
		if (ValidationUtil
				.isEmpty(
						(employeeAndReporting.getDateOfRelieving() != null) ? employeeAndReporting
								.getDateOfRelieving().toString() : null,
						"Date of Relieving", null, FacesContext
								.getCurrentInstance()) != null) {
			System.out.println("Display Name is empty.");
			FORM_VALID = false;
		}
		if (ValidationUtil.isEmpty(employee.getRelieved(), "Relieved", null,
				FacesContext.getCurrentInstance()) != null) {
			System.out.println("Relieved is empty.");
			FORM_VALID = false;
		}*/
		
	}

	public void registrationThroughEformToggleListener(ActionEvent e) {
		System.out.println("CALLED");
		System.out.println(REGISTRATION_THROUGH_EFORM);
		REGISTRATION_THROUGH_EFORM = ((MenuItem)e.getComponent()).getValue().toString();
		if (REGISTRATION_THROUGH_EFORM != null && REGISTRATION_THROUGH_EFORM.equals("Yes")) {
			newJoineesList = newJoineeDAO.getUnregisteredNewJoinees();
		} else {
			employee = new Employee();
			employee.setEmployeeCode(employeeDAO.generateEmployeeCode());
		}
	}

	public Long getSelectedModuleId() {
		return selectedModuleId;
	}

	public void setSelectedModuleId(Long selectedModuleId) {
		this.selectedModuleId = selectedModuleId;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public EmployeeAndReporting getEmployeeAndReporting() {
		return employeeAndReporting;
	}

	public void setEmployeeAndReporting(
			EmployeeAndReporting employeeAndReporting) {
		this.employeeAndReporting = employeeAndReporting;
	}

	public Long getSelectedRoleId() {
		return selectedRoleId;
	}

	public void setSelectedRoleId(Long selectedRoleId) {
		this.selectedRoleId = selectedRoleId;
	}

	public Map<String, Long> getRolesMap() {
		return rolesMap;
	}

	public void setRolesMap(Map<String, Long> rolesMap) {
		this.rolesMap = rolesMap;
	}

	public String getAuthentication() {
		return authentication;
	}

	public void setAuthentication(String authentication) {
		this.authentication = authentication;
	}

	public Map<String, String> getSaperpModules() {
		return saperpModules;
	}

	public void setSaperpModules(Map<String, String> saperpModules) {
		this.saperpModules = saperpModules;
	}

	public Long getSelectedSAPERPModule() {
		return selectedSAPERPModule;
	}

	public void setSelectedSAPERPModule(Long selectedSAPERPModule) {
		this.selectedSAPERPModule = selectedSAPERPModule;
	}

	public List<SAPERPModule> getSaperpModulesList() {
		return saperpModulesList;
	}

	public void setSaperpModulesList(List<SAPERPModule> saperpModulesList) {
		this.saperpModulesList = saperpModulesList;
	}



	public List<EmployeeAndReporting> getEmployeeAndReportinList() {
		return employeeAndReportinList;
	}

	public void setEmployeeAndReportinList(
			List<EmployeeAndReporting> employeeAndReportinList) {
		this.employeeAndReportinList = employeeAndReportinList;
	}

	public Map<String, Long> getEmployeeAndReportingMap() {
		return employeeAndReportingMap;
	}

	public void setEmployeeAndReportingMap(
			Map<String, Long> employeeAndReportingMap) {
		this.employeeAndReportingMap = employeeAndReportingMap;
	}


	public Long getSelectedDesignationId() {
		return selectedDesignationId;
	}

	public void setSelectedDesignationId(Long selectedDesignationId) {
		this.selectedDesignationId = selectedDesignationId;
	}

	public Map<String, String> getProjectsStatusMap() {
		return projectsStatusMap;
	}

	public void setProjectsStatusMap(Map<String, String> projectsStatusMap) {
		this.projectsStatusMap = projectsStatusMap;
	}

	public Long getSelectedProjectsStatusId() {
		return selectedProjectsStatusId;
	}

	public void setSelectedProjectsStatusId(Long selectedProjectsStatusId) {
		this.selectedProjectsStatusId = selectedProjectsStatusId;
	}

	public Map<String, String> getAuthenticationsMap() {
		return authenticationsMap;
	}

	public void setAuthenticationsMap(Map<String, String> authenticationsMap) {
		this.authenticationsMap = authenticationsMap;
	}

	public Long getSelectedAuthenticatoin() {
		return selectedAuthenticatoin;
	}

	public void setSelectedAuthenticatoin(Long selectedAuthenticatoin) {
		this.selectedAuthenticatoin = selectedAuthenticatoin;
	}

	public Map<String, String> getResignedMap() {
		return resignedMap;
	}

	public void setResignedMap(Map<String, String> resignedMap) {
		this.resignedMap = resignedMap;
	}

	public Long getSelectedResigned() {
		return selectedResigned;
	}

	public void setSelectedResigned(Long selectedResigned) {
		this.selectedResigned = selectedResigned;
	}

	public boolean isFORM_VALID() {
		return FORM_VALID;
	}

	public void setFORM_VALID(boolean fORM_VALID) {
		FORM_VALID = fORM_VALID;
	}

	public WAMUser getWamUser() {
		return wamUser;
	}

	public void setWamUser(WAMUser wamUser) {
		this.wamUser = wamUser;
	}

	public EmployeeRole getEmployeeRole() {
		return employeeRole;
	}

	public void setEmployeeRole(EmployeeRole employeeRole) {
		this.employeeRole = employeeRole;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public Long getSelectedCompetencyLeadId() {
		return selectedCompetencyLeadId;
	}

	public void setSelectedCompetencyLeadId(Long selectedCompetencyLeadId) {
		this.selectedCompetencyLeadId = selectedCompetencyLeadId;
	}

	public Map<String, Long> getCompetencyLeadsMap() {
		return competencyLeadsMap;
	}

	public void setCompetencyLeadsMap(Map<String, Long> competencyLeadsMap) {
		this.competencyLeadsMap = competencyLeadsMap;
	}

	public Long getSelectedProjectManagerId() {
		return selectedProjectManagerId;
	}

	public void setSelectedProjectManagerId(Long selectedProjectManagerId) {
		this.selectedProjectManagerId = selectedProjectManagerId;
	}

	public Map<String, Long> getProjectManagersMap() {
		return projectManagersMap;
	}

	public void setProjectManagersMap(Map<String, Long> projectManagersMap) {
		this.projectManagersMap = projectManagersMap;
	}

	public Long getSelectedCenterHeadId() {
		return selectedCenterHeadId;
	}

	public void setSelectedCenterHeadId(Long selectedCenterHeadId) {
		this.selectedCenterHeadId = selectedCenterHeadId;
	}

	public Map<String, Long> getCenterHeadMap() {
		return centerHeadMap;
	}

	public void setCenterHeadMap(Map<String, Long> centerHeadMap) {
		this.centerHeadMap = centerHeadMap;
	}

	public List<Employee> getCompetencyLeads() {
		return competencyLeads;
	}

	public void setCompetencyLeads(List<Employee> competencyLeads) {
		this.competencyLeads = competencyLeads;
	}

	public List<Employee> getProjectManagers() {
		return projectManagers;
	}

	public void setProjectManagers(List<Employee> projectManagers) {
		this.projectManagers = projectManagers;
	}

	public List<Employee> getCenterHeads() {
		return centerHeads;
	}

	public void setCenterHeads(List<Employee> centerHeads) {
		this.centerHeads = centerHeads;
	}

	public String getSelectedDesignation() {
		return selectedDesignation;
	}

	public void setSelectedDesignation(String selectedDesignation) {
		this.selectedDesignation = selectedDesignation;
	}

	public String getSelectedProject() {
		return selectedProject;
	}

	public void setSelectedProject(String selectedProject) {
		this.selectedProject = selectedProject;
	}

	public List<Project> getProjects() {
		return projects;
	}

	public void setProjects(List<Project> projects) {
		this.projects = projects;
	}

	public Map<String, String> getProjectsMap() {
		return projectsMap;
	}

	public void setProjectsMap(Map<String, String> projectsMap) {
		this.projectsMap = projectsMap;
	}

	public List<NewJoinee> getNewJoineesList() {
		return newJoineesList;
	}

	public void setNewJoineesList(List<NewJoinee> newJoineesList) {
		this.newJoineesList = newJoineesList;
	}

	public NewJoineeDAO getNewJoineeDAO() {
		return newJoineeDAO;
	}

	public void setNewJoineeDAO(NewJoineeDAO newJoineeDAO) {
		this.newJoineeDAO = newJoineeDAO;
	}

	public HtmlInputText getFirstNameInputText() {
		return firstNameInputText;
	}

	public void setFirstNameInputText(HtmlInputText firstNameInputText) {
		this.firstNameInputText = firstNameInputText;
	}

	public HtmlInputText getLastNameInputText() {
		return lastNameInputText;
	}

	public void setLastNameInputText(HtmlInputText lastNameInputText) {
		this.lastNameInputText = lastNameInputText;
	}

	public HtmlInputText getDateOfJoiningInputText() {
		return dateOfJoiningInputText;
	}

	public void setDateOfJoiningInputText(HtmlInputText dateOfJoiningInputText) {
		this.dateOfJoiningInputText = dateOfJoiningInputText;
	}

	public HtmlInputText getDateOfBirthInputText() {
		return dateOfBirthInputText;
	}

	public void setDateOfBirthInputText(HtmlInputText dateOfBirthInputText) {
		this.dateOfBirthInputText = dateOfBirthInputText;
	}

	public HtmlInputText getTelephoneInputText() {
		return telephoneInputText;
	}

	public void setTelephoneInputText(HtmlInputText telephoneInputText) {
		this.telephoneInputText = telephoneInputText;
	}

	public HtmlInputText getEmailInputText() {
		return emailInputText;
	}

	public void setEmailInputText(HtmlInputText emailInputText) {
		this.emailInputText = emailInputText;
	}

	public NewJoinee getSelectedNewJoinee() {
		return selectedNewJoinee;
	}

	public void setSelectedNewJoinee(NewJoinee selectedNewJoinee) {
		this.selectedNewJoinee = selectedNewJoinee;
	}

	public byte[] getImage() {
		return image;
	}

	public void setImage(byte[] image) {
		this.image = image;
	}

	public UploadedFile getFile() {
		return file;
	}

	public void setFile(UploadedFile file) {
		this.file = file;
	}

	public InputStream getIs() {
		return is;
	}

	public void setIs(InputStream is) {
		this.is = is;
	}

	public WAMUser getWamUserToRegister() {
		return wamUserToRegister;
	}

	public void setWamUserToRegister(WAMUser wamUserToRegister) {
		this.wamUserToRegister = wamUserToRegister;
	}

	public Employee getCenterHead() {
		return centerHead;
	}

	public void setCenterHead(Employee centerHead) {
		this.centerHead = centerHead;
	}

	public Employee getProjectManager() {
		return projectManager;
	}

	public void setProjectManager(Employee projectManager) {
		this.projectManager = projectManager;
	}

	public Employee getCompetency() {
		return competency;
	}

	public void setCompetency(Employee competency) {
		this.competency = competency;
	}

	public Role getSelectedRole() {
		return selectedRole;
	}

	public void setSelectedRole(Role selectedRole) {
		this.selectedRole = selectedRole;
	}

	public Map<String,String> getProjectStatusMap() {
		return projectStatusMap;
	}

	public void setProjectStatusMap(Map<String,String> projectStatusMap) {
		this.projectStatusMap = projectStatusMap;
	}

	public EmailUtil getEmailUtil() {
		return emailUtil;
	}

	public void setEmailUtil(EmailUtil emailUtil) {
		this.emailUtil = emailUtil;
	}

	public String getEMAIL_MESSAGE() {
		return EMAIL_MESSAGE;
	}

	public void setEMAIL_MESSAGE(String eMAIL_MESSAGE) {
		EMAIL_MESSAGE = eMAIL_MESSAGE;
	}

	public List<LeaveType> getLeaveTypes() {
		return leaveTypes;
	}

	public void setLeaveTypes(List<LeaveType> leaveTypes) {
		this.leaveTypes = leaveTypes;
	}

	public LeaveBalance getLeaveBalance() {
		return leaveBalance;
	}

	public void setLeaveBalance(LeaveBalance leaveBalance) {
		this.leaveBalance = leaveBalance;
	}

	public List<LeaveBalance> getLeaveBalancesToBeAssigned() {
		return leaveBalancesToBeAssigned;
	}

	public void setLeaveBalancesToBeAssigned(
			List<LeaveBalance> leaveBalancesToBeAssigned) {
		this.leaveBalancesToBeAssigned = leaveBalancesToBeAssigned;
	}

	public String getREGISTRATION_THROUGH_EFORM() {
		return REGISTRATION_THROUGH_EFORM;
	}

	public void setREGISTRATION_THROUGH_EFORM(String rEGISTRATION_THROUGH_EFORM) {
		REGISTRATION_THROUGH_EFORM = rEGISTRATION_THROUGH_EFORM;
	}

	public EmailUtil getItTeamEmailUtil() {
		return itTeamEmailUtil;
	}



	public void setItTeamEmailUtil(EmailUtil itTeamEmailUtil) {
		this.itTeamEmailUtil = itTeamEmailUtil;
	}


	public List<LookupValue> getLookupValuesList() {
		return lookupValuesList;
	}


	public void setLookupValuesList(List<LookupValue> lookupValuesList) {
		this.lookupValuesList = lookupValuesList;
	}


	public Map<String, String> getDesignationsMap() {
		return designationsMap;
	}


	public void setDesignationsMap(Map<String, String> designationsMap) {
		this.designationsMap = designationsMap;
	}


	public boolean isRENDER_OTHER_MODULE() {
		return RENDER_OTHER_MODULE;
	}


	public void setRENDER_OTHER_MODULE(boolean rENDER_OTHER_MODULE) {
		RENDER_OTHER_MODULE = rENDER_OTHER_MODULE;
	}


	public String getOtherModule() {
		return otherModule;
	}


	public void setOtherModule(String otherModule) {
		this.otherModule = otherModule;
	}


	public boolean isRENDER_OTHER_DESIGNATION() {
		return RENDER_OTHER_DESIGNATION;
	}


	public void setRENDER_OTHER_DESIGNATION(boolean rENDER_OTHER_DESIGNATION) {
		RENDER_OTHER_DESIGNATION = rENDER_OTHER_DESIGNATION;
	}


	public String getOtherDesignation() {
		return otherDesignation;
	}


	public void setOtherDesignation(String otherDesignation) {
		this.otherDesignation = otherDesignation;
	}

}
